#!/bin/sh

clean_workspace() {
  rm -rf build paths.txt
}

main() {
  trap 'clean_workspace' EXIT

  clean_workspace

  find . -name \*.java > paths.txt

  javac -d build @paths.txt || exit 1

  ( cd build && java proyecto/Main )
}

main
